package com.roncoo.education.course.service.api;

import javax.validation.constraints.NotNull;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.roncoo.education.common.core.base.Page;
import com.roncoo.education.common.core.base.Result;
import com.roncoo.education.course.service.api.biz.ApiPostBiz;
import com.roncoo.education.course.service.api.req.ApiPostPageReq;
import com.roncoo.education.course.service.api.resp.ApiPostPageResp;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;

/**
 * API-实验信息
 *
 * @author wujing
 * @date 2023-07-24
 */
@Api(tags = "API-实验信息")
@RestController
@RequiredArgsConstructor
@RequestMapping("/course/api/post")
public class ApiPostController {

    @NotNull
    private final ApiPostBiz biz;
    
    /**
     * 新闻公告信息列表接口
     *
     * @author fengyw
     */
    @ApiOperation(value = "列表和搜索接口", notes = "根据条件进行课程列出")
    @RequestMapping(value = "/search", method = RequestMethod.POST)
    public Result<Page<ApiPostPageResp>> searchForPage(@RequestBody ApiPostPageReq req) {
        return biz.searchForPage(req);
    }    
    
    /**
     * 新闻公告详情接口
     */
    @ApiOperation(value = "公告资讯详情接口", notes = "根据公告资讯ID获取信息")
    @RequestMapping(value = "/view", method = RequestMethod.POST)
    public Result<ApiPostPageResp> view(@RequestBody ApiPostPageReq req) {
        return biz.view(req);
    }  
    

}
